package head.first.model.factory.demo1;

/**
 * Created by yiyongyao on 2018/2/28.
 * <p/>
 * 披萨店的基本功能   创建者类
 */
public abstract class PizzaStore {

    //定制批萨,这个在不同的批萨店是不同的口味批萨
    protected abstract Pizza createPizza(String type);

    //接收订单,各个店面相同
    public Pizza orderPizza(String type) {
        Pizza pizza;
        pizza = createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;

    }

}
